package com.hylanda.pb.service.common;

/**
 * @author zhangy
 * @E-mail:blackoon88@gmail.com
 * @qq:846579287
 * @version created at：2018年1月19日 上午11:18:50 note
 */
public class ConstantHelper {
	/***
	 * power bi azure
	 */

	public static String ver = "0.2.0";
	public static String aud = "https://analysis.windows.net/powerbi/api";
	public static String iss = "Power BI Node SDK";
	public static String type = "embed";
	@Deprecated
	public static final String Authorization = "AppKey rE1nqSmvcFjBFBA9qNuajqTwT48/33Qp2wsWs44adq2EEWWSD5YAHfb+2wojONrv4ehfuYp7+gyOHnXJrak5uQ==";

	public static final String collectionName = "reidxtree";

	public static final String workspaceID = "e7cc1354-6480-4030-bf0c-9d9c80845dba";

	public static final String dataSetDisplayName = "defaultName";
	
	// powerBi 获取导入状态 Get
	public static final String getImportStatus = "https://api.powerbi.cn/v1.0/collections/{collectionName}/workspaces/{workspaceID}/imports/{importId}";
	
	//powerBi 报表导入 POST
	public static final String reportImport="https://api.powerbi.cn/v1.0/collections/{collectionName}/workspaces/{workspaceID}/imports?datasetDisplayName={datasetDisplayName}";
	
	//powerBi 获取网关及数据源信息 GET
	public static final String getBoundGatewayDatasources="https://api.powerbi.cn/v1.0/collections/{collectionName}/workspaces/{workspaceID}/datasets/{datasetID}/Default.GetBoundGatewayDatasources";
	
	//powerBi 更新数据源凭据(PATCH GatewayDatasource)
	public static final String patchGatewayDatasource="https://api.powerbi.cn/v1.0/collections/{collectionName}/workspaces/{workspaceID}/gateways/{gatewayID}/datasources/{datasourceID}";
	
	//删除数据集
	public static final String deleteDataset="https://api.powerbi.cn/v1.0/collections/{collectionName}/workspaces/{workspaceID}/datasets/{datasetID}";
		
	public static final String ERROR_HEAD = "500";
	public static final String RESPONSE_FAIL="fail";
	public static final String RESPONSE_SUCCESS="success";

	public static long getCurrentTime() {
		return System.currentTimeMillis() / 1000;
	}

	public static long getOneHourLaterTime() {
		return (System.currentTimeMillis() / 1000 + 3600);
	}
	public static long getOneDateLaterTime() {
		return (System.currentTimeMillis() / 1000 + 3600*24);
	}
	
	/**
	 * powerbi local
	 */
	/**
	 *上传报表接口集合 
	 */
	public static final String uploadCatalogItem_post="/reports/api/v2.0/CatalogItems";
	public static final String getCatalogItemInfo_get="/reports/api/v2.0/CatalogItems(Path='/name')?&$expand=DataSources";
	public static final String updateDataSource_patch="/reports/api/v2.0/PowerBIReports(bigItem.Id)/DataSources";
	public static final String updateDataSource_patch2="/reports/api/v2.0/PowerBIReports(Path='/path')/DataSources";
	
	/**
	 * 创建文件夹集合
	 */
	//Gets an array of Folder CatalogItems.
	public static final String folder_get="/reports/api/v2.0/CatalogItems";
	//Creates a new Folder CatalogItem.
	public static final String folder_post="/reports/api/v2.0/Catalogitems";
	
}
